package com.wugh.fast.module.mapper.interceptor.plugin;

import com.wugh.fast.module.mapper.EntityInfo;
import lombok.Getter;
import lombok.Setter;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * 说明: 默认的插件实现
 *
 * @author wugh
 * @date 2018-09-25 17:43
 */
public abstract class AbstractPlugin implements CustomizePlugin {
    protected EntityInfo entityInfo;
    @Getter
    @Setter
    protected int index;

    public AbstractPlugin() {
        this.index = 0;
    }

    @Override
    public EntityInfo getEntityInfo() {
        return this.entityInfo;
    }

    @Override
    public boolean support(EntityInfo entityInfo) {
        this.entityInfo = entityInfo;
        return true;
    }

    @Override
    public void autoHandleExample(Example example) {

    }

    @Override
    public void autoHandleUpdateRecord(Object record) {

    }

    @Override
    public void autoHandleInsertList(List recordList) {

    }

    @Override
    public void autoHandleInsert(Object record) {

    }

    @Override
    public void autoHandleInsertSelective(Object record) {

    }
}
